package com.mars.admin.modules.post.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mars.admin.modules.base.entity.BaseEntity;
import com.mars.admin.framework.listener.EntityChangeListener;
import com.mybatisflex.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 话题实体类
 *
 * @author Mars
 * @version 1.0
 * @date 2025-01-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Table(value = "tb_topic", onInsert = EntityChangeListener.class, onUpdate = EntityChangeListener.class)
@Schema(description = "话题")
public class Topic extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 话题ID
     */
    @Id(keyType = KeyType.Auto)
    @Schema(description = "话题ID", example = "1")
    private Long id;

    /**
     * 话题名称
     */
    @Schema(description = "话题名称", example = "潮游分享", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("name")
    private String name;

    /**
     * 话题描述
     */
    @Schema(description = "话题描述", example = "分享你的潮流旅行体验")
    @Column("description")
    private String description;

    /**
     * 话题封面图
     */
    @Schema(description = "话题封面图", example = "https://example.com/cover.jpg")
    @Column("cover_image")
    private String coverImage;

    /**
     * 话题图标
     */
    @Schema(description = "话题图标", example = "travel")
    @Column("icon")
    private String icon;

    /**
     * 话题颜色
     */
    @Schema(description = "话题颜色", example = "#1890ff")
    @Column("color")
    private String color;

    /**
     * 话题分类
     */
    @Schema(description = "话题分类", example = "travel")
    @Column("category")
    private String category;

    /**
     * 帖子数量
     */
    @Schema(description = "帖子数量", example = "100")
    @Column("posts_count")
    private Integer postsCount;

    /**
     * 关注数量
     */
    @Schema(description = "关注数量", example = "50")
    @Column("followers_count")
    private Integer followersCount;

    /**
     * 是否热门
     */
    @Schema(description = "是否热门：0-否，1-是", example = "1")
    @Column("is_hot")
    private Integer isHot;

    /**
     * 是否官方话题
     */
    @Schema(description = "是否官方话题：0-否，1-是", example = "1")
    @Column("is_official")
    private Integer isOfficial;

    /**
     * 排序
     */
    @Schema(description = "排序", example = "1")
    @Column("sort_order")
    private Integer sortOrder;

    /**
     * 状态
     */
    @Schema(description = "状态：0-禁用，1-启用", example = "1")
    @Column("status")
    private Integer status;

} 